<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__STATIC__/css/layui.css">
    <link rel="stylesheet" href="__STATIC__/css/view.css" />
    <link rel="icon" href="/favicon.ico">
    <style>
        .layui-upload-img {
            width: 92px;
            height: 92px;
            margin: 0 10px 10px 0;
        }
       
        .layui-input{
            width: 300px;
        }
    </style>
    <title>管理后台</title>
</head>

<body class="layui-view-body">
    <div class="layui-content">
        <div class="layui-row">
            <div class="layui-card">
                <div class="layui-card-header">添加商品</div>
                <form class="layui-form layui-card-body" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">商品规格</label>
                        <div class="layui-input-block">
                            <input type="text" width="200" id="shop_spc_name" name="title" required lay-verify="required"
                                placeholder="请输入商品规格" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商品价格</label>
                        <div class="layui-input-block">
                            <input type="text" width="200" id="shop_price" name="title" required lay-verify="required"
                                placeholder="请输入商品价格" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商品库存</label>
                        <div class="layui-input-block">
                            <input type="text" width="200" id="shop_stock" name="title" required lay-verify="required"
                                placeholder="请输入商品库存" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商品重量</label>
                        <div class="layui-input-block">
                            <input type="text" width="200" id="shop_weight" name="title" required lay-verify="required"
                                placeholder="请输入商品重量" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="button" class="layui-btn layui-btn-blue" onclick="article_save()">立即提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    {include file="common/footer"}
    <script src="__STATIC__/layui.all.js"></script>
    <script>
        var shopId = '{$shopId}'
        function article_save() {
            var shop_spc_name = $("#shop_spc_name").val();
            var shop_price = $("#shop_price").val();
            var shop_stock = $("#shop_stock").val();
            var shop_weight = $("#shop_weight").val();
            $.ajax({
                url: '{:Url("Shop/info_add")}',
                type: 'POST',
                data: {
                    "shop_id":shopId,
                    "shop_spc_name": shop_spc_name,
                    "shop_price": shop_price,
                    "shop_stock": shop_stock,
                    "shop_weight": shop_weight,
                },
                dataType: 'text',
                success: function (res) {
                    layer.msg('修改成功');
                }
            })
        }
    </script>
</body>

</html>